import './js/libs/weapp-adapter'
var THREE = require('./js/libs/three');
var scene = new THREE.Scene();
// t 透视相机
var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
var context = canvas.getContext('webgl');
var renderer = new THREE.WebGLRenderer(context);
renderer.setSize(window.innerWidth, window.innerHeight);
canvas.appendChild(renderer.domElement);
// 立方体
var geometry = new THREE.CubeGeometry(1, 1, 1);
// 材质
var material = new THREE.MeshBasicMaterial({color: 0x00ff00});
// 柔和
var cube = new THREE.Mesh(geometry, material);
// 添加到场景
scene.add(cube);
camera.position.z = 5;
function render() {
    requestAnimationFrame(render);
    cube.rotation.x += 0.1;
    cube.rotation.y += 0.1;
    renderer.render(scene, camera);
}
render();